<!DOCTYPE html>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>The source code</title>
  <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  <style type="text/css">
    .highlight { display: block; background-color: #ddd; }
  </style>
  <script type="text/javascript">
    function highlight() {
      document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
    }
  </script>
</head>
<body onload="prettyPrint(); highlight();">
  <pre class="prettyprint lang-js"><span id='global-property-'>/**
</span> * @ignore
 * Production for KISON
 * @author yiminghe@gmail.com
 */
KISSY.add(&quot;kison/production&quot;, function (S, Base) {
<span id='KISSY-Kison-Production'>    /**
</span>     * production for grammar
     * @class KISSY.Kison.Production
     */
   return Base.extend({
        equals: function (other) {
            var self = this;
            if (!S.equals(other.get(&quot;rhs&quot;), self.get(&quot;rhs&quot;))) {
                return false;
            }
            return other.get(&quot;symbol&quot;) == self.get(&quot;symbol&quot;);

        },

        toString: function (dot) {
            var rhsStr = &quot;&quot;;
            var rhs = this.get(&quot;rhs&quot;);
            S.each(rhs, function (r, index) {
                if (index == dot) {
                    rhsStr += &quot; . &quot;;
                }
                rhsStr += r+' ';
            });
            if (dot == rhs.length) {
                rhsStr += &quot; . &quot;;
            }
            return this.get(&quot;symbol&quot;) + &quot; =&gt; &quot; + rhsStr;
        }
    }, {
        ATTRS: {
            firsts: {
                value: {}
            },
            follows: {
                value: []
            },
            symbol: {},
            rhs: {
                value: []
            },
            nullable: {
                value: false
            },
            action: {
                // action for this production
            }
        }
    });
}, {
    requires: ['base']
});</pre>
</body>
</html>
